#ifndef __SER_H__
#define __SER_H__
#include"threadPool.h"
#include"reactor.h"
#include"ipAddressPort.h"
#include"tcpServer.h"
#include"ipAddressPort.h"

#include<mutex>
#include<memory>


class Ser
{
public:
static std::shared_ptr<Ser> GetInstance(std::string,size_t,size_t);
private:
Ser()=delete;
Ser(std::string ,size_t ,size_t);
Ser(const Ser&)=delete;
Ser & operator=(const Ser&)=delete;
public:
using event_callback_fun = std::function<void(int,short,void *)>;
static void AcceptCfd(int ,short ,void * );
 Reactor & GetReactor();
const TcpServer & Getser()const;
 static void ListenEventsCallback(int ,short,void *);
private:
  ThreadPool  pool_;
  Reactor reactor_;
  static std::shared_ptr<Ser> serInstance_;
  TcpServer ser_;
  static std::mutex mutex_;
};
#endif
